package fi.foyt.cs.api.json;

import java.util.Locale;

import org.json.JSONException;
import org.json.JSONObject;

import fi.foyt.cs.persistence.domainmodel.scene.SceneCategory;

public class SceneCategoryRenderer implements EntityRenderer<SceneCategory> {

  @Override
  public JSONObject getAsJson(Locale locale, SceneCategory sceneCategory) {
    JSONObject jsonObject = new JSONObject();

    try {
      jsonObject.put("id", sceneCategory.getId().getId());
      jsonObject.put("name", sceneCategory.getName());
      
    } catch (JSONException e) {
      throw new RenderingException(e);
    }

    return jsonObject;
  }
}
